<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>cartlist.jsp</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <script src="<c:url value='/jquery/jquery-1.5.1.js'/>"></script>
    <script src="<c:url value='/js/round.js'/>"></script>

    <link rel="stylesheet" type="text/css" href="<c:url value='/jsps/css/cart/list.css'/>">

</head>
<body>
<c:choose>
    <c:when test="${empty cartItemList }">
<table width="95%" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td align="right">
            <img align="top" src="<c:url value='/images/icon_empty.png'/>"/>
        </td>
        <td>
            <span class="spanEmpty">您的书单中没有任何图书</span>
        </td>
    </tr>
</table>
    </c:when>
    <c:otherwise>
<table width="95%" align="center" cellpadding="0" cellspacing="0">
    <tr align="center" bgcolor="#efeae5">
        <td colspan="2">图书名称</td>
        <td>状态</td>
    </tr>
    <c:forEach items="${cartItemList }" var="cartItem">
        <tr align="center">
            <td align="left" width="70px">
                <a class="linkImage" href="<c:url value='/jsps/book/desc.jsp'/>"><img border="0" width="54" align="top"
                                                                                      src="<c:url value='/${cartItem.book.image_b }'/>"/></a>
            </td>
            <td align="left" width="400px">
                <a href="<c:url value='/jsps/book/desc.jsp'/>"><span>${cartItem.book.bname }</span></a>
            </td>
            <td>
                <a href="<c:url value='/CartItemServlet?method=batchDelete&cartItemIds=${cartItem.cartItemId }'/>">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
<form id="form1" action="<c:url value='/jsps/cart/showitem.jsp'/>" method="post">
    <input type="hidden" name="cartItemIds" id="cartItemIds"/>
    <input type="hidden" name="method" value="loadCartItems"/>
</form>
    </c:otherwise>
</c:choose>

</body>
</html>
